@extends('admin.app')

@section('content')
  <div class="panel panel-default">
    <div class="panel-heading font-bold">
      代码信息表单
    </div>
    <div class="panel-body">
      <form class="form-horizontal form-validation" action="{{ admin_action('System\MenusController@update', [$menu]) }}" method="post">
        {{ csrf_field() }}
        {{ method_field('PUT') }}
        <div class="form-group">
          <label class="col-lg-2 control-label">名称*</label>
          <div class="col-lg-10">
            <input type="text" class="form-control" name="name" value="{{ $menu['name'] }}" placeholder="请输入名称" data-rule-required="true" data-rule-maxlength="20"> 
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <label class="col-lg-2 control-label">控制器*</label>
          <div class="col-lg-10">
            <input type="text" class="form-control" name="action" value="{{ $menu['action'] }}" placeholder="请输入控制器" data-rule-required="true" data-rule-maxlength="200"> 
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <label class="col-lg-2 control-label">父级菜单</label>
          <div class="col-lg-10">
            <p class="form-control-static">
            @forelse ($parents as $row)
              {{ $row['name'] }}
            @empty
              {{ '无' }}
            @endforelse
            </p>
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <label class="col-lg-2 control-label">描述</label>
          <div class="col-lg-10">
            <textarea class="form-control" rows="4" name="description" placeholder="请输入描述信息" data-rule-maxlength="100">{{ $menu['description'] }}</textarea>              
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <label class="col-lg-2 control-label">图标</label>
          <div class="col-lg-10">
            <input type="text" class="form-control" name="icon" value="{{ $menu['icon'] }}" placeholder="请输入图标" data-rule-maxlength="20"> 
          </div>
        </div>
        <div class="line line-dashed b-b line-lg"></div>
        <div class="form-group">
          <div class="col-lg-4 col-lg-offset-2">
            <a href="{{ admin_action('System\MenusController@index') }}" class="btn btn-default">返&nbsp;回</a>
            <button type="submit" class="btn btn-primary">保&nbsp;存</button>
          </div>
        </div>
      </form>
    </div>
  </div>
@endsection